import React, { Component } from "react";

export default class UseRefs extends Component {
  handleClick = () => {
    console.log("ul上面的事件");
    console.log(this);
  };
  handleClick1 = () => {
    console.log("点击1的事件");
    console.log(this);
  };
  handleClick2 = (event) => {
    console.log("点击2的事件");
    console.log(this);
    event.stopPropagation();
  };

  render() {
    return (
      <ul onClick={this.handleClick}>
        <li onClick={this.handleClick1}>点击1</li>
        <li onClick={event => this.handleClick2(event)}>点击2</li>
        <li>点击3</li>
      </ul>
    );
  }
}
